<style>
 div {
 font-size:18px;
 width: 950px;
 padding:5px;
 }

 #mid{
	position:absolute;
	top:20%;
	right:2px;
	margin:-150px 0 0 -150px;
	width:10px;
	height:150px;
	position:absolute;
 }

 table {
   background:black;
   font-size:14px;
 }

 table th,td {
   background:white;
   color:black;
   padding:5px;
   text-align:center;
 }
 .l {
   text-align:left;
 }

 .c {
   text-align:center;
 }

 .r {
   text-align:right;
 }
 .col{
    font-size:18px;
    height:35px;
    line-height:26px;
 }
 .input{
   border:none;
   border-bottom:solid 1px black;
   font-size:18px;
}
</style>
<div style="text-align:center; font-size:36px"><strong>销 售 合 同</strong></div>
<div style="text-align:right;font-size:18px"><strong>订货编号：<font color="red"><%=@order.order_no%></font></strong>&nbsp;&nbsp;</div>
<div id="mid">
第一联存根<br/><br/>
第二联客户<br/><br/>
第三联财务
</div>
<table width='940px' cellpadding="1" cellspacing="1">
  <tr>
    <th class="col">货号</th>
	<th class="col">花色</th>
	<th class="col">产品名称</th>
	<th class="col">规格</th>
	<th class="col">数量</th>
	<th class="col">单价</th>
	<th class="col">金 额</th>
	<th class="col">备 注</th>
  </tr>
  <%@order.order_items.each do |order_item| %>
  <tr>
    <td class='l'><%= order_item.furniture_code %></td>
    <td class='l'><%= order_item.furniture_color %></td>
	<td class='l'><%= order_item.furniture_name %></td>
	<td class='l'><%= order_item.furniture_spec %></td>
	<td class='r'><%= order_item.ordered_count %></td>
	<td class='r'></td>
	<td class='r'></td>
	<td class='l'><%= order_item.remark %></td>
  </tr>
  <%end%>
  <tr>
    <td colspan="7" class='l col' height="35">合计金额（大写）：<%=number_to_capital_zh(@order.sale_price)%></td>
	<td class='l'>￥：<%=number_with_precision(@order.sale_price, :precision => 2)%></td>
  </tr>
  <tr>
    <td colspan="7" class='l col' height="35">定金金额（大写）：<%=number_to_capital_zh(@order.order_price)%></td>
	<td class='l'>￥：<%=number_with_precision(@order.order_price, :precision => 2)%></td>
  </tr>
  <tr>
    <td colspan="7" class='l col' height="35">余款金额（大写）：<%=number_to_capital_zh(@order.balance)%></td>
	<td class='l'>￥：<%=number_with_precision(@order.balance, :precision => 2)%></td>
  </tr>
  <tr>
    <td colspan="8" class='l col' height="150">
	 双方协定条款：<br/>
	 &nbsp;&nbsp;1、验收标准：质量、款式以本商场样品为标准验收。<br/>
	 &nbsp;&nbsp;2、已订产品，不退定金。<br/>
	 &nbsp;&nbsp;3、货款结算方式：<input type="text" class="input" style="width:80%;" readonly/><br/>
	 &nbsp;&nbsp;4、其它特定条款：<input type="text" class="input" style="width:80%;" readonly/><br/>
	 &nbsp;&nbsp;5、送货时间：<input type="text" class="input" style="width:80%;" value="<%=@order.deliveried_on%>" readonly/><br/>
	 &nbsp;&nbsp;6、送货地点：<input type="text" class="input" style="width:80%;" value="<%=@order.buyer_address%>" readonly/>
	</td>
  </tr>
  <tr>
    <td colspan="4" class='l col'>
	客户签署：<input type="text" class="input" style="width:50%;" readonly/><br/>
	电话：<input type="text" class="input" style="width:35%;" readonly/>
	手机：<input type="text" class="input" style="width:35%;" value="<%=@order.buyer_phone%>" readonly/><br/>
	时间：<input type="text" class="input" style="width:15%;" readonly/>年
	<input type="text" class="input" style="width:15%;" readonly/>月
	<input type="text" class="input" style="width:15%;" readonly/>日
	</td>
	<td colspan="4" class='l col'>
	经办人签署：<input type="text" class="input" style="width:50%;" readonly/><br/>
	电话：<input type="text" class="input" style="width:35%;" readonly/>
	手机：<input type="text" class="input" style="width:35%;" readonly/><br/>
	时间：<input type="text" class="input" style="width:15%;" readonly/>年
	<input type="text" class="input" style="width:15%;" readonly/>月
	<input type="text" class="input" style="width:15%;" readonly/>日
	</td>
  </tr>
</table>
<div>
<div style="text-align:left; width:50%; position:relative; float:left">仓管：</div>
<div style="text-align:left; width:40%; position:relative; float:right">送货人：</div>
</div><br/>
<div>
  <div style="text-align:left; width:50%; position:relative; float:left">
  地址：<%=@order.enterprise.address%>
  </div>
  <div style="text-align:left; width:40%; position:relative; float:right">
  TEL：<%=@order.enterprise.link_phone%>
  </div>
</div>

